<?php

namespace app\backend\validator;

use think\Validate;

class UpdCategoryValidator extends Validate
{
    protected $rule = [
        'id'            => 'require',
        'category_name' => 'min:2|max:200',
        'img_url'       => 'min:6|max:255',
        'status'        => 'in:0,1'
    ];

    protected $message = [
        'id.require' => '商品分类ID必填',
        'category_name.min' => '商品分类名称长度不能小于2个字符',
        'category_name.max' => '商品分类名称长度不能超过200个字符',
        'img_url.min' => '商品分类图片长度不能小于6个字符',
        'img_url.max' => '商品分类图片长度不能超过255个字符',
        'status.int' => '未知商品分类状态类型',
    ];
}